home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 April / macformat-049.iso / mac / Shareware Plus / Developers / dropg++ / usr / include / sys / systm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  6.7 KB  |  166 lines  |  [TEXT/R*ch]

  1. /*-
  2.  * Copyright (c) 1982, 1988, 1991, 1993
  3.  *    The Regents of the University of California.  All rights reserved.
  4.  * (c) UNIX System Laboratories, Inc.
  5.  * All or some portions of this file are derived from material licensed
  6.  * to the University of California by American Telephone and Telegraph
  7.  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  8.  * the permission of UNIX System Laboratories, Inc.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  * 3. All advertising materials mentioning features or use of this software
  19.  *    must display the following acknowledgement:
  20.  *    This product includes software developed by the University of
  21.  *    California, Berkeley and its contributors.
  22.  * 4. Neither the name of the University nor the names of its contributors
  23.  *    may be used to endorse or promote products derived from this software
  24.  *    without specific prior written permission.
  25.  *
  26.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  27.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  30.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  32.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  33.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  34.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  35.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  36.  * SUCH DAMAGE.
  37.  *
  38.  *    @(#)systm.h    8.4 (Berkeley) 2/23/94
  39.  */
  40.  
  41. /*
  42.  * The `securelevel' variable controls the security level of the system.
  43.  * It can only be decreased by process 1 (/sbin/init).
  44.  *
  45.  * Security levels are as follows:
  46.  *   -1    permannently insecure mode - always run system in level 0 mode.
  47.  *    0    insecure mode - immutable and append-only flags make be turned off.
  48.  *    All devices may be read or written subject to permission modes.
  49.  *    1    secure mode - immutable and append-only flags may not be changed;
  50.  *    raw disks of mounted filesystems, /dev/mem, and /dev/kmem are
  51.  *    read-only.
  52.  *    2    highly secure mode - same as (1) plus raw disks are always
  53.  *    read-only whether mounted or not. This level precludes tampering 
  54.  *    with filesystems by unmounting them, but also inhibits running
  55.  *    newfs while the system is secured.
  56.  *
  57.  * In normal operation, the system runs in level 0 mode while single user
  58.  * and in level 1 mode while multiuser. If level 2 mode is desired while
  59.  * running multiuser, it can be set in the multiuser startup script
  60.  * (/etc/rc.local) using sysctl(1). If it is desired to run the system
  61.  * in level 0 mode while multiuser, initialize the variable securelevel
  62.  * in /sys/kern/kern_sysctl.c to -1. Note that it is NOT initialized to
  63.  * zero as that would allow the vmunix binary to be patched to -1.
  64.  * Without initialization, securelevel loads in the BSS area which only
  65.  * comes into existence when the kernel is loaded and hence cannot be
  66.  * patched by a stalking hacker.
  67.  */
  68. extern int securelevel;        /* system security level */
  69. extern const char *panicstr;    /* panic message */
  70. extern char version[];        /* system version */
  71. extern char copyright[];    /* system copyright */
  72.  
  73. extern int nblkdev;        /* number of entries in bdevsw */
  74. extern int nchrdev;        /* number of entries in cdevsw */
  75. extern int nswdev;        /* number of swap devices */
  76. extern int nswap;        /* size of swap space */
  77.  
  78. extern int selwait;        /* select timeout address */
  79.  
  80. extern u_char curpriority;    /* priority of current process */
  81.  
  82. extern int maxmem;        /* max memory per process */
  83. extern int physmem;        /* physical memory */
  84.  
  85. extern dev_t dumpdev;        /* dump device */
  86. extern long dumplo;        /* offset into dumpdev */
  87.  
  88. extern dev_t rootdev;        /* root device */
  89. extern struct vnode *rootvp;    /* vnode equivalent to above */
  90.  
  91. extern dev_t swapdev;        /* swapping device */
  92. extern struct vnode *swapdev_vp;/* vnode equivalent to above */
  93.  
  94. extern struct sysent {        /* system call table */
  95.     int    sy_narg;    /* number of arguments */
  96.     int    (*sy_call)();    /* implementing function */
  97. } sysent[];
  98.  
  99. extern int boothowto;        /* reboot flags, from console subsystem */
  100.  
  101. /* casts to keep lint happy */
  102. #define    insque(q,p)    _insque((caddr_t)q,(caddr_t)p)
  103. #define    remque(q)    _remque((caddr_t)q)
  104.  
  105. /*
  106.  * General function declarations.
  107.  */
  108. int    nullop __P((void));
  109. int    enodev __P((void));
  110. int    enoioctl __P((void));
  111. int    enxio __P((void));
  112. int    eopnotsupp __P((void));
  113. int    seltrue __P((dev_t dev, int which, struct proc *p));
  114. void    *hashinit __P((int count, int type, u_long *hashmask));
  115.  
  116. #ifdef __GNUC__
  117. volatile void    panic __P((const char *, ...));
  118. #else
  119. void    panic __P((const char *, ...));
  120. #endif
  121. void    tablefull __P((const char *));
  122. void    addlog __P((const char *, ...));
  123. void    log __P((int, const char *, ...));
  124. void    printf __P((const char *, ...));
  125. int    sprintf __P((char *buf, const char *, ...));
  126. void    ttyprintf __P((struct tty *, const char *, ...));
  127.  
  128. void    bcopy __P((const void *from, void *to, u_int len));
  129. void    ovbcopy __P((const void *from, void *to, u_int len));
  130. void    bzero __P((void *buf, u_int len));
  131.  
  132. int    copystr __P((void *kfaddr, void *kdaddr, u_int len, u_int *done));
  133. int    copyinstr __P((void *udaddr, void *kaddr, u_int len, u_int *done));
  134. int    copyoutstr __P((void *kaddr, void *udaddr, u_int len, u_int *done));
  135. int    copyin __P((void *udaddr, void *kaddr, u_int len));
  136. int    copyout __P((void *kaddr, void *udaddr, u_int len));
  137.  
  138. int    fubyte __P((void *base));
  139. #ifdef notdef
  140. int    fuibyte __P((void *base));
  141. #endif
  142. int    subyte __P((void *base, int byte));
  143. int    suibyte __P((void *base, int byte));
  144. int    fuword __P((void *base));
  145. int    fuiword __P((void *base));
  146. int    suword __P((void *base, int word));
  147. int    suiword __P((void *base, int word));
  148.  
  149. int    hzto __P((struct timeval *tv));
  150. void    timeout __P((void (*func)(void *), void *arg, int ticks));
  151. void    untimeout __P((void (*func)(void *), void *arg));
  152. void    realitexpire __P((void *));
  153.  
  154. struct clockframe;
  155. void    hardclock __P((struct clockframe *frame));
  156. void    softclock __P((void));
  157. void    statclock __P((struct clockframe *frame));
  158.  
  159. void    initclocks __P((void));
  160.  
  161. void    startprofclock __P((struct proc *));
  162. void    stopprofclock __P((struct proc *));
  163. void    setstatclockrate __P((int hzrate));
  164.  
  165. #include <libkern/libkern.h>
  166.